//
//  PoftfilioDetailBottomView.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/15.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "PoftfilioDetailBottomView.h"

@implementation PoftfilioDetailBottomView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.goStoreControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (self.PoftfilioDetailBottomViewBlock) {
            self.PoftfilioDetailBottomViewBlock(PoftfilioDetailBottomType_store);
        }
    }];
    
    [self.collectControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (self.PoftfilioDetailBottomViewBlock) {
            self.PoftfilioDetailBottomViewBlock(PoftfilioDetailBottomType_collect);
        }
    }];
    
    [self.phoneCallControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (self.PoftfilioDetailBottomViewBlock) {
            self.PoftfilioDetailBottomViewBlock(PoftfilioDetailBottomType_phone);
        }
    }];
    
    [self.subscribeControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (self.PoftfilioDetailBottomViewBlock) {
            self.PoftfilioDetailBottomViewBlock(PoftfilioDetailBottomType_subscribe);
        }
    }];
}

- (IBAction)handleAction:(id)sender {
    if (self.PoftfilioDetailBottomViewBlock) {
        self.PoftfilioDetailBottomViewBlock(PoftfilioDetailBottomType_im);
    }
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.handleBtn pp_clipCorners:UIRectCornerAllCorners radius:self.handleBtn.frame.size.height/2];
    self.phoneCallControl.hidden = YES;
    self.subscribeControl.frame = self.phoneCallControl.frame;
}

@end
